package cn.xiuxian.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class DbConfigUtil {

    private  static     Properties properties  = new Properties();

    static {
        InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("config/dbconfig.properties");
        try {
            properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    public  static  String getValue(String key ){
        return  properties.getProperty(key);
    }
    public static void main(String[] args) {
        System.out.println(getValue("url"));
        System.out.println(getValue("username"));
        System.out.println(getValue("password"));
    }
}
